//
// Created by HP on 2025/11/17.
//

#ifndef FLIGHTSERVER_TICKETOPERATION_H
#define FLIGHTSERVER_TICKETOPERATION_H

#include "Model.h"
#include <string>

class TicketOperationType {
public:
    static const std::string buyTicket;
    static const std::string sellTicket;
    static const std::string refundTicket;
};

// 记录买票，卖票，退票等操作
class TicketOperation : public Model {
public:
    std::string id;
    std::string userId;         // 操作用户ID
    std::string ticketId;       // 关联票ID
    std::string operationType;  // 操作类型：buyTicket/sellTicket/refundTicket
    std::string quantity;       // 操作数量
    std::string price;         // 操作价格
    std::string createdAt;    // 操作时间

    TicketOperation();

    void bind(const std::string& key, const std::string& value);

    bool save();
};


#endif //FLIGHTSERVER_TICKETOPERATION_H
